﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.Linq;
using CSM.Models;
using CSM.Controllers;

namespace CSM.Views.Menu
{
    public partial class LeftMenu : System.Web.UI.Page
    {
        private CustomDataContext db = new CustomDataContext();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session[SystemVars.sysSessionUserAuths] == null || string.IsNullOrEmpty(Session[SystemVars.sysSessionUserAuths].ToString()))
                    throw new Exception("没有登录！");
                CSMMenu menu = new CSMMenu();
                TreeView1.Nodes.Add(menu.GetOwnLeftMenu((List<int>)Session[SystemVars.sysSessionUserAuths]));
            }
            //string names = "4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,21,22,23,24,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72";
            //List<int> auths = new List<int>();
            //var authsStr = names.Split(',');
            //foreach (var s in authsStr)
            //auths.Add(Convert.ToInt32(s));
            //TreeView2.Nodes.Add(GetOwnLeftMenu(auths));
        }


    }
}
